/**
 *
 * @author Max Granz
 * Spielt das .midi-Lied im Hintergrund ab
 */
import java.io.IOException;
import javax.microedition.media.*;

public class MusicPlayer {

    public MusicPlayer() {
        player();
    }
    public Player pl;

    public void player() {
        try {
            pl = Manager.createPlayer(InputStreams.sound[system.getRnd(1)], "audio/midi");
            pl.start();
        } catch (IOException ex) {
        } catch (MediaException ex) {
        }
    }

    public boolean fertig() {
        if (pl.getDuration() == pl.getMediaTime()) {
            return true;
        } else {
            return false;
        }
    }
}
